package com.roger.query.service.impl;

import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.Query;

import com.roger.query.service.QueryService;
import com.roger.vo.PhrasesQueryParams;

/**
 * 短语查询(短语的前后顺序可变，这个是和SpanNearQuery最重要的区别)
 * @author luoweiyi
 */
public class PhraseQueryServiceImpl implements QueryService<PhrasesQueryParams> {

	@Override
	public Query getQuery(PhrasesQueryParams params) {
		PhraseQuery query = new PhraseQuery(params.getSlop(), params.getField(), params.getField());
		return query;
	}

}
